package com.snda.lib.util;

import java.io.File;
import android.content.Context;
import android.os.Environment;

public class LibSettings {

	public static String getCacheDir(Context context) {
		return context.getCacheDir().getAbsolutePath();
	}

	public static String getFileDir(Context context) {
		return context.getFilesDir().getAbsolutePath();
	}

	/** Get the current value of the g2Android path option */
	public static String getLibPath(Context context) {
		File externalStorageDirectory = Environment
				.getExternalStorageDirectory();
		return new StringBuilder()
				.append(externalStorageDirectory.getAbsolutePath()).append("/")
				.append("snlib").toString();
	}

	/**
	 * 获取图片存储路径
	 * 
	 * @param context
	 * @return
	 */
	public static String getImagePath(Context context) {

		return new StringBuilder().append(getLibPath(context)).append("/")
				.append("image").append("/").toString();
	}

	/**
	 * 获取下载文件存储路径
	 * 
	 * @param context
	 * @return
	 */
	public static String getDownloadPath(Context context) {
		return new StringBuilder().append(getLibPath(context)).append("/")
				.append("download").append("/").toString();
	}

	/**
	 * 获取Http响应缓存目录
	 * 
	 * @param context
	 * @return
	 */
	public static String getResponsePath(Context context) {
		return new StringBuilder().append(getLibPath(context)).append("/")
				.append("response").append("/").toString();
	}

}
